using UnityEngine;

public class Apple : Obstacle
{
    // Start is called once before the first execution of Update after the MonoBehaviour is created
    public float attackRange,speed;
    bool isAttack;
    void Start()
    {
        
    }

    // Update is called once per frame
    void Update()
    {
        base.Update();
        if(transform.position.x-Bubble.I.transform.position.x<attackRange)
        {
            isAttack=true;
        }
        if(isAttack)
        {
            transform.position+=Vector3.down*speed*Time.deltaTime;
        }
    }
}
